<?php
/**
 * Generate an anchor tag for an admin tab
 * @return anchor tag
 */
function admin_tab($target, $title, $icon, $active = false)
{
	$link = 'admin/'.$target;
	if ($active) {
		echo '<li>'.anchor($link, icon_tag($icon).' '.$title, 'class="active"').'</li>';
	}
	else {
		echo '<li>'.anchor($link, icon_tag($icon).' '.$title).'</li>';
	}
}
?>

<ul id="main_navigation">
	<?php
	$main = $context['main_navigation'];

	admin_tab('contents',                   'Le site',       'world',   $main == 'site');
	admin_tab('candidats/main_list',        'Candidats',     'user',    $main == 'candidats');
	admin_tab('medias',                     'Médias',        'monitor', $main == 'medias');
	admin_tab('config',                     'Configuration', 'wrench',  $main == 'config');
	admin_tab('admincontroller/disconnect', 'Déconnexion',   'disconnect');
	?>
</ul>
